﻿using RulesEngine.Rule;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RulesEngine
{
    public class RuleManager
    {
        List<BaseRule> list = new List<BaseRule>();

        public void AddRule(BaseRule rule)
        {
            list.Add(rule);
        }

        public void run(Object data)
        {
            for (int i = 0; i < list.Count; i++)
            {
                list[i].RuleObject = data;
                list[i].run();
            }
        }
    }
}
